package com.example.demo.controller;

import com.example.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class UserController {
    //Autowired 依赖注入 —— 会在IOC容器中找到对应的类型，如果找到，就给该属性进行赋值
    @Autowired
    UserService userService;
    @RequestMapping("/getinfo")
    public void getinfo(){
        userService.print();
    }
}
